from time import sleep
from base import Base
from selenium.webdriver.common.by import By
class BeiJingPage(Base):

    beijingtag = (By.XPATH,'//android.widget.TextView[@text="北京"]')

    sousuokuang='new UiSelector().resourceId("cn.xuexi.android:id/text")'

    shurukuang = (By.ID,'android:id/search_src_text')

    dy = (By.XPATH,'//android.widget.TextView[@text="二十大报告"]')
    dy2 = (By.ID,'android:id/search_close_btn')
    dy3 = (By.XPATH,'/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.LinearLayout[1]/android.widget.RelativeLayout/android.widget.SearchView/android.widget.LinearLayout/android.widget.LinearLayout/android.widget.LinearLayout/android.widget.EditText')

    def beijingshiwu(self):

        self.find_ele(self.beijingtag).click()
        sleep(3)
        self.find_ele(self.sousuokuang).click()
        sleep(3)
        self.find_ele(self.shurukuang).click()
        sleep(3)

    def ershidashiwu(self,c):

        self.find_ele(self.sousuokuang).click()
        sleep(3)
        self.find_ele(self.shurukuang).click()
        sleep(3)
        self.find_ele(self.shurukuang).send_keys(c)
        sleep(3)

